import java.util.Scanner;

public class Main1397 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        for (int i = 0; i < arr.length; i++) {
            int g = arr[i] % 10;//ge
            int s = arr[i] / 10 % 10;//shi
            int b = arr[i] / 100 % 10;//bai=
            int q = arr[i] / 1000;//qian==4
            if (arr[i] >= 10 && arr[i] <= 99) {
                if (g % 2 == 0 && s % 2 == 0) {
                    System.out.println(arr[i]);
                }
            }
            if (arr[i] >999 && arr[i] <10000)
                if (g%2 == 0 && s %2 == 0 && b % 2 == 0 && q%2==0) {
                    System.out.println(arr[i]);
                }
            }
        }
    }



